﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;

namespace ToDoListTest
{
    class InputRequire
    {
        public static string InputString(string require)
        {
            Console.WriteLine(require);
            return Console.ReadLine();

        }
        public static int InputInt(string require)
        {
            while (true)
            {
                try
                {
                    Console.WriteLine(require);
                    int result = Convert.ToInt32(Console.ReadLine());
                    return result;
                }
                catch(Exception e)
                {
                    Console.WriteLine("You input the number exception:" + e.Message);
                    Console.WriteLine("Input again:");
                }

            }
        }
        public static DateTime InputDateTime(string require)
        {
                     Console.WriteLine(require);
                     return Convert.ToDateTime(Console.ReadLine());
         
         }
      }
}
